/************************************************************************/
// file		: OutputBuffer.h											//
// date		: 2013-5-11  17:15											//
// author	: hotlala8088@gmail.com                                     //     
// version	: 1.0.0														//
// brief	:                                                           //         
/************************************************************************/
#ifndef __INPUTBUFFER_H__
#define __INPUTBUFFER_H__
#include <ace/Message_Block.h>
#include <google/protobuf/stubs/common.h>
#include <google/protobuf/io/zero_copy_stream_impl.h>
class InputBuffer 
	: public ::google::protobuf::io::ZeroCopyInputStream
{
public:
	InputBuffer(size_t size);
	InputBuffer(ACE_Message_Block * buffer);
	~InputBuffer();
public:
	bool Next(void const ** data, int* size);
	void BackUp(int count);
	bool Skip(int count);
	::google::protobuf::int64 ByteCount() const;

private:
	ACE_Message_Block *buffer_;
};
#endif